﻿/*----------------------------------------------------------------
   Copyright (C) 2017 - CXC

   文件名：ACResponseBase.cs
   文件功能描述：AC请求响应基类


   创建标识：CXC @ 2017-06-12

----------------------------------------------------------------*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace AcSDK.Core
{
    /// <summary>
    /// AC请求响应基类.
    /// </summary>
    [Serializable]
    public abstract class AcResponseBase
    {
        /// <summary>
        /// 错误码
        /// </summary>
        [XmlElement("code")]
        public string Code { get; set; }

        /// <summary>
        /// 错误信息
        /// </summary>
        [XmlElement("msg")]
        public string Msg { get; set; }

        /// <summary>
        /// 响应原始内容
        /// </summary>
        public string Body { get; set; }


        /// <summary>
        /// 响应结果是否错误
        /// </summary>
        public bool HaveError
        {
            get { return Convert.ToInt32(Code) != 0; }
        }


    }
}
